<!doctype html>
<html>

<head>
  <meta name="generator" content="JSDoc 3.6.11">
  <meta charset="utf-8">
  <title>whatsapp-web.js 1.34.2 &raquo; Class: MessageMedia</title>
  <link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
  <link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
  <link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
  <link href="css/baseline.css" rel="stylesheet">
</head>

<body onload="prettyPrint()">
  <nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
    <div id="jsdoc-navbar-container">
      <div id="jsdoc-navbar-content">
        <a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>34.<wbr>2</a>
      </div>
    </div>
  </nav>
  <div id="jsdoc-body-container">
    <div id="jsdoc-content">
      <div id="jsdoc-content-container">
        <div id="jsdoc-main" role="main">
          <header class="page-header">
            <div class="symbol-detail-labels"><span class="label label-kind">class</span></div>
            <h1><small></small><span class="symbol-name">MessageMedia</span></h1>
            <p class="source-link">Source: <a href="structures_MessageMedia.js.html#source-line-16">structures/<wbr>MessageMedia.<wbr>js:16</a></p>
            <div class="symbol-classdesc">
              <p>Media attached to a message</p>
            </div>
            <dl class="dl-compact">
            </dl>
          </header>
          <section id="summary">
            <div class="summary-callout">
              <h2 class="summary-callout-heading">Properties</h2>
              <div class="summary-content">
                <div class="summary-column">
                  <dl class="dl-summary-callout">
                    <dt><a href="MessageMedia.html#data">data</a></dt>
                    <dd>
                    </dd>
                    <dt><a href="MessageMedia.html#filename">filename</a></dt>
                    <dd>
                    </dd>
                  </dl>
                </div>
                <div class="summary-column">
                  <dl class="dl-summary-callout">
                    <dt><a href="MessageMedia.html#filesize">filesize</a></dt>
                    <dd>
                    </dd>
                    <dt><a href="MessageMedia.html#mimetype">mimetype</a></dt>
                    <dd>
                    </dd>
                  </dl>
                </div>
                <div class="summary-column">
                </div>
              </div>
            </div>
            <div class="summary-callout">
              <h2 class="summary-callout-heading">Methods</h2>
              <div class="summary-content">
                <div class="summary-column">
                  <dl class="dl-summary-callout">
                    <dt><a href="MessageMedia.html#.fromFilePath">fromFilePath(filePath)</a></dt>
                    <dd>
                    </dd>
                  </dl>
                </div>
                <div class="summary-column">
                  <dl class="dl-summary-callout">
                    <dt><a href="MessageMedia.html#.fromUrl">fromUrl(url[, options])</a></dt>
                    <dd>
                    </dd>
                  </dl>
                </div>
                <div class="summary-column">
                </div>
              </div>
            </div>
          </section>
          <section>
            <h2 id="MessageMedia">new&nbsp;<span class="symbol-name">MessageMedia</span><span class="signature"><span class="signature-params">(mimetype, data, filename, filesize)</span></span></h2>
            <section>
              <h3>Parameters</h3>
              <table class="jsdoc-details-table">
                <thead>
                  <tr>
                    <th>Name</th>
                    <th>Type</th>
                    <th>Optional</th>
                    <th>Description</th>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td>
                      <p>mimetype</p>
                    </td>
                    <td>
                      <p>&nbsp;</p>
                    </td>
                    <td>
                      <p>&nbsp;</p>
                    </td>
                    <td>
                      <p>MIME type of the attachment</p>
                    </td>
                  </tr>
                  <tr>
                    <td>
                      <p>data</p>
                    </td>
                    <td>
                      <p>&nbsp;</p>
                    </td>
                    <td>
                      <p>&nbsp;</p>
                    </td>
                    <td>
                      <p>Base64-encoded data of the file</p>
                    </td>
                  </tr>
                  <tr>
                    <td>
                      <p>filename</p>
                    </td>
                    <td>
                      <p>&nbsp;</p>
                    </td>
                    <td>
                      <p>&nbsp;</p>
                    </td>
                    <td>
                      <p>Document file name. Value can be null</p>
                      <p>Value can be null.</p>
                    </td>
                  </tr>
                  <tr>
                    <td>
                      <p>filesize</p>
                    </td>
                    <td>
                      <p>&nbsp;</p>
                    </td>
                    <td>
                      <p>&nbsp;</p>
                    </td>
                    <td>
                      <p>Document file size in bytes. Value can be null</p>
                      <p>Value can be null.</p>
                    </td>
                  </tr>
                </tbody>
              </table>
            </section>
            <dl class="dl-compact">
            </dl>
          </section>
          <section>
            <h2>Properties</h2>
            <section>
              <h3 id="data"><span class="symbol-name">data</span><small class="property-type">
                  &nbsp;string</small></h3>
              <p>Base64 encoded data that represents the file</p>
              <dl class="dl-compact">
              </dl>
              <h3 id="filename"><span class="symbol-name">filename</span><small class="property-type">
                  &nbsp;nullable string</small></h3>
              <p>Document file name. Value can be null</p>
              <dl class="dl-compact">
              </dl>
              <h3 id="filesize"><span class="symbol-name">filesize</span><small class="property-type">
                  &nbsp;nullable number</small></h3>
              <p>Document file size in bytes. Value can be null</p>
              <dl class="dl-compact">
              </dl>
              <h3 id="mimetype"><span class="symbol-name">mimetype</span><small class="property-type">
                  &nbsp;string</small></h3>
              <p>MIME type of the attachment</p>
              <dl class="dl-compact">
              </dl>
            </section>
            <h2>Methods</h2>
            <section>
              <div class="symbol-detail-labels"><span class="label label-static">static</span></div>
              <h3 id=".fromFilePath"><span class="symbol-name">fromFilePath</span><span class="signature"><span class="signature-params">(filePath)</span>&nbsp;&rarr; <span class="signature-returns"> <a href="MessageMedia.html">MessageMedia</a></span></span></h3>
              <p>Creates a MessageMedia instance from a local file path</p>
              <section>
                <h4>Parameter</h4>
                <table class="jsdoc-details-table">
                  <thead>
                    <tr>
                      <th>Name</th>
                      <th>Type</th>
                      <th>Optional</th>
                      <th>Description</th>
                    </tr>
                  </thead>
                  <tbody>
                    <tr>
                      <td>
                        <p>filePath</p>
                      </td>
                      <td>
                        <p>string</p>
                      </td>
                      <td>
                        <p>&nbsp;</p>
                      </td>
                      <td>
                      </td>
                    </tr>
                  </tbody>
                </table>
              </section>
              <dl class="dl-compact">
                <dt>Returns</dt>
                <dd>
                  <p><code><a href="MessageMedia.html">MessageMedia</a></code> </p>
                </dd>
              </dl>
              <div class="symbol-detail-labels"><span class="label label-async">async</span>&nbsp;<span class="label label-static">static</span></div>
              <h3 id=".fromUrl"><span class="symbol-name">fromUrl</span><span class="signature"><span class="signature-params">(url[, options])</span>&nbsp;&rarr; <span class="signature-returns"> Promise containing <a href="MessageMedia.html">MessageMedia</a></span></span></h3>
              <p>Creates a MessageMedia instance from a URL</p>
              <section>
                <h4>Parameters</h4>
                <table class="jsdoc-details-table">
                  <thead>
                    <tr>
                      <th>Name</th>
                      <th>Type</th>
                      <th>Optional</th>
                      <th>Description</th>
                    </tr>
                  </thead>
                  <tbody>
                    <tr>
                      <td>
                        <p>url</p>
                      </td>
                      <td>
                        <p>string</p>
                      </td>
                      <td>
                        <p>&nbsp;</p>
                      </td>
                      <td>
                      </td>
                    </tr>
                    <tr>
                      <td>
                        <p>options</p>
                      </td>
                      <td>
                        <p>Object</p>
                      </td>
                      <td>
                        <p>Yes</p>
                      </td>
                      <td>
                        <p>Values in <code>options</code> have the following properties:</p>
                        <table class="jsdoc-details-table">
                          <thead>
                            <tr>
                              <th>Name</th>
                              <th>Type</th>
                              <th>Optional</th>
                              <th>Description</th>
                            </tr>
                          </thead>
                          <tbody>
                            <tr>
                              <td>
                                <p>unsafeMime</p>
                              </td>
                              <td>
                                <p>boolean</p>
                              </td>
                              <td>
                                <p>Yes</p>
                              </td>
                              <td>
                                <p>Defaults to <code>false</code>.</p>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <p>filename</p>
                              </td>
                              <td>
                                <p>string</p>
                              </td>
                              <td>
                                <p>Yes</p>
                              </td>
                              <td>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <p>client</p>
                              </td>
                              <td>
                                <p>object</p>
                              </td>
                              <td>
                                <p>Yes</p>
                              </td>
                              <td>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <p>reqOptions</p>
                              </td>
                              <td>
                                <p>object</p>
                              </td>
                              <td>
                                <p>Yes</p>
                              </td>
                              <td>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <p>reqOptions.size</p>
                              </td>
                              <td>
                                <p>number</p>
                              </td>
                              <td>
                                <p>Yes</p>
                              </td>
                              <td>
                                <p>Defaults to <code>0</code>.</p>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </td>
                    </tr>
                  </tbody>
                </table>
              </section>
              <dl class="dl-compact">
                <dt>Returns</dt>
                <dd>
                  <p><code>Promise containing <a href="MessageMedia.html">MessageMedia</a></code> </p>
                </dd>
              </dl>
            </section>
          </section>
        </div>
      </div>
      <nav id="jsdoc-toc-nav" role="navigation"></nav>
    </div>
  </div>
  <footer id="jsdoc-footer" class="jsdoc-footer">
    <div id="jsdoc-footer-container">
      <p>
        Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.11 on November 6, 2025.
      </p>
    </div>
  </footer>
  <script src="scripts/jquery.min.js"></script>
  <script src="scripts/tree.jquery.js"></script>
  <script src="scripts/prettify.js"></script>
  <script src="scripts/jsdoc-toc.js"></script>
  <script src="scripts/linenumber.js"></script>
  <script src="scripts/scrollanchor.js"></script>
</body>

</html>